//
//  MYStatusCellBottomView.m
//  MYChatting
//
//  Created by mac on 16/8/20.
//  Copyright © 2016年 lhf. All rights reserved.
//

#import "MYStatusCellBottomView.h"
#import "Masonry.h"


@interface MYStatusCellBottomView ()

@property (nonatomic,weak) UIButton *retweetedBtn;//转发按钮
@property (nonatomic,weak) UIButton *commentBtn;//评论按钮
@property (nonatomic,weak) UIButton *likeBtn;//喜欢按钮


@end


@implementation MYStatusCellBottomView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self setUpUI];
    }
    return self;
}


- (void)setUpUI{
    
    UIButton *retweetedBtn = [[UIButton alloc] init];
    [retweetedBtn setTitle:@"转发" forState:UIControlStateNormal];
    [retweetedBtn setImage:[UIImage imageNamed:@"timeline_icon_retweet"] forState:UIControlStateNormal];
    [retweetedBtn setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    retweetedBtn.titleLabel.font = [UIFont systemFontOfSize:10];
    [self addSubview:retweetedBtn];
    self.retweetedBtn =retweetedBtn ;
    
    UIButton *commentBtn = [[UIButton alloc] init];
    [commentBtn setTitle:@"评论" forState:UIControlStateNormal];
    [commentBtn setImage:[UIImage imageNamed:@"timeline_icon_comment"] forState:UIControlStateNormal];
    [commentBtn setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    commentBtn.titleLabel.font = [UIFont systemFontOfSize:10];
    [self addSubview:commentBtn];
    self.commentBtn = commentBtn;
    
    UIButton *likeBtn = [[UIButton alloc] init];
    [likeBtn setTitle:@"赞" forState:UIControlStateNormal];
    [likeBtn setImage:[UIImage imageNamed:@"timeline_icon_like"] forState:UIControlStateNormal];
    [likeBtn setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    likeBtn.titleLabel.font = [UIFont systemFontOfSize:10];
    [self addSubview:likeBtn];
    self.likeBtn = likeBtn;
    
    //增加分割线
    UIView *sepView1 = [[UIView alloc] init];
    sepView1.backgroundColor = [UIColor darkGrayColor];
    [self addSubview:sepView1];
    
    UIView *sepView2 = [[UIView alloc] init];
    sepView2.backgroundColor = [UIColor darkGrayColor];
    [self addSubview:sepView2];
    
    [retweetedBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.equalTo(self);
    }];
    
    [commentBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(retweetedBtn.mas_right);
        make.top.bottom.equalTo(self);
        make.width.equalTo(retweetedBtn.mas_width);
        
    }];
    
    [likeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.right.equalTo(self);
        make.left.equalTo(commentBtn.mas_right);
        make.width.equalTo(commentBtn.mas_width);
    }];
    
    
    [sepView1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(retweetedBtn.mas_right);
        make.height.equalTo(self.mas_height).multipliedBy(0.4);
        make.width.mas_equalTo(0.5);
        make.centerY.equalTo(self.mas_centerY);
    }];
    
    [sepView2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(commentBtn.mas_right);
        make.height.equalTo(self.mas_height).multipliedBy(0.4);
        make.width.mas_equalTo(0.5);
        make.centerY.equalTo(self.mas_centerY);
    }];
    
}



@end
